﻿<UserControl x:Class="WordAssistantApp.EtymaView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:XWord.Fundamental.Domain;assembly=XWord.Fundamental.Domain"
    >
    <UserControl.Resources>
        <Style x:Key="viewItem" TargetType="{x:Type TreeViewItem}">
            <Setter Property="IsExpanded" Value="False"/>
        </Style>
        <HierarchicalDataTemplate  DataType="{x:Type local:Etyma}" ItemsSource="{Binding Children}">
            <StackPanel Orientation="Horizontal">
               
                    <TextBlock Text="{Binding Name}" Margin="0,0,10,0">
                         <TextBlock.ContextMenu>
                    <ContextMenu>
                        <MenuItem Header="新增词根" Click="MenuItem_Click_4"></MenuItem>
                        <MenuItem Header="关联词汇" Click="MenuItem_Click_3"></MenuItem>
                        <MenuItem Header="新增子节点" Click="MenuItem_Click_1"></MenuItem>
                        <MenuItem Header="修改" Click="MenuItem_Click"></MenuItem>
                        <MenuItem Header="删除" Click="MenuItem_Click_2"></MenuItem>
                    </ContextMenu>
                </TextBlock.ContextMenu>
                    </TextBlock>
                <TextBlock Text="{Binding Comment}"></TextBlock>
            </StackPanel>
           
        </HierarchicalDataTemplate>
    </UserControl.Resources>
    <Grid>
            <TreeView x:Name="tree" ItemsSource="{Binding}" ItemContainerStyle="{StaticResource viewItem}" />
    </Grid>
</UserControl>
